<!-- wyf 2022-3-14 -->
<template>
  <a-dropdown-button
    :disabled="disabled"
    :size="size"
    :type="type"
    :placement="placement"
    :trigger="trigger"
    :visible="visible"
  >
    <template v-if="$slots.overlay" #overlay>
      <slot name="overlay" />
    </template>
    <template v-if="$slots.icon" #icon>
      <slot name="icon" />
    </template>
    <slot />
  </a-dropdown-button>
</template>

<script>
import { defineComponent } from 'vue'
import { DropdownButton } from 'ant-design-vue'

export default defineComponent({
  name: 'ZDropdownButton',
  components: {
    ADropdownButton: DropdownButton
  },
  props: {
    disabled: {
      type: Boolean,
      default: false
    },
    size: {
      type: String,
      default: undefined
    },
    type: {
      type: String,
      default: undefined
    },
    placement: {
      type: String,
      default: 'bottomLeft'
    },
    trigger: {
      type: Array,
      default() {
        return ['hover']
      }
    },
    visible: {
      type: Boolean,
      default: undefined
    }
  }
})
</script>
